package com.jack.thinking.thread.core._1;

public class InterruptBeforeSleep extends Thread{
	@Override
	public void run() {
		super.run();
		
		for(int i = 0 ; i < 1000000 ; i++) {
			System.out.println("i = " + i);
		}
		
		System.out.println("RUN begin" +  this.isInterrupted());
		
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		System.out.println("RUN end" + this.isInterrupted());
	}
	
	public static void main(String[] args) {
		InterruptBeforeSleep tbs = new InterruptBeforeSleep();
		tbs.start();
		tbs.interrupt();
		System.out.println("END");
	}
}
